164131113eabad6def164c64eaf90f97478076af,source/com/intellij/openapi/vcs/impl/ModuleVcsPathPresenter.java,ModuleVcsPathPresenter,getPresentableRelativePath,#ContentRevision#ContentRevision#,51

Before Change


      }
    }
    final RelativePathCalculator calculator =
      new RelativePathCalculator(toRevision.getFile().getIOFile().getAbsolutePath(), fromRevision.getFile().getIOFile().getAbsolutePath());
    calculator.execute();
    final String result = calculator.getResult();
    return (result == null) ? null : result.replace("/", File.separator);

After Change


  public String getPresentableRelativePath(final ContentRevision fromRevision, final ContentRevision toRevision) {
    // need to use parent path because the old file is already not there
    FilePath fromPath = fromRevision.getFile();
    FilePath toPath = toRevision.getFile();

    if (fromPath == null || toPath == null || (fromPath.getParentPath() == null) || (toPath.getParentPath() == null)) {
      return null;
    }

    final VirtualFile oldFile = fromPath.getParentPath().getVirtualFile();
    final VirtualFile newFile = toPath.getParentPath().getVirtualFile();
    if (oldFile != null && newFile != null) {
      Module oldModule = ModuleUtil.findModuleForFile(oldFile, myProject);
      Module newModule = ModuleUtil.findModuleForFile(newFile, myProject);
      if (oldModule != newModule) {
        return getPresentableRelativePathFor(oldFile);
      }
    }
    if (toPath.getIOFile() == null || fromPath.getIOFile() == null) {
      return null;
    }
    final RelativePathCalculator calculator =
      new RelativePathCalculator(toPath.getIOFile().getAbsolutePath(), fromPath.getIOFile().getAbsolutePath());